import axios from 'axios';

export interface RaceItemCreateDTO {
  raceItemName: string;
  raceItemDescription: string;
}

export interface GetRaceListParams {
  curPage?: number;
  pageSize?: number;
  dateField?: string;
  startDate?: string;
  endDate?: string;
  orderField?: string;
  orderType?: string;
  rangeField?: string;
  rangeLValue?: string;
  rangeRValue?: string;
  search?: string;
  searchField?: string;
  statusField?: string;
  statusValue?: string;
}

export function getRaceList(data?: GetRaceListParams) {
  return axios.get('/admin-api/race/list', {
    params: data,
  });
}

export function addRaceItem(data: RaceItemCreateDTO) {
  return axios.post('/admin-api/race/create/raceItem', data);
}

export function deleteRaceItem(raceItemId: number) {
  return axios.delete(`/admin-api/race/delete/${raceItemId}`);
}
